package cn.jdx.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import lombok.Data;
import lombok.ToString;

import java.util.Date;

@Data
@ToString
public class User {
    private Long id;
    private String name;
    private Integer age;
    private String email;
    //增加如下注解:
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;
    //添加乐观锁
    @Version //乐观锁的注解
    private Integer version;
    //逻辑删除
    @TableLogic //逻辑删除
    private Integer deleted;
}
